/*
 * CCreator.h
 *
 *  Created on: 14 Oct 2012
 *      Author: Mario Kleinsasser
 *		Time:	17:38:34
 */

#ifndef CCREATOR_H_
#define CCREATOR_H_

#include "CItem.h"

using namespace std;

/* CREATOR */

class CItemCreator {
protected:

	/* THIS IS THE FACTORY CLASS*/

	/*
	 * First we need the base class pointer that this factory will create types of
	 */

	CItem *item;

	/* This method must not be implemented by the CREATORS like the environment
	 * the create method is implicit used by the newItem public method
	 * the factory client uses the newItem interface this provides a generic interface
	 */
	virtual CItem* create(const char *itemtype) = 0;

public:

	CItemCreator();
	virtual ~CItemCreator();

	virtual CItem* newItem(const char *itemtype){
		return create(itemtype);
	}

};

#endif /* CCREATOR_H_ */
